﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using igather.Framework;

namespace igather.Framework.Clustering
{
    public class ClusteredGraph
    {
        private List<Cluster> clusters;
        private String[] colors = new String[10]
        {
            "Blue",
            "Green",
            "Yellow",
            "Black",
            "Red",
            "Orange",
            "Grey",
            "Pink",
            "Purple",
            "Brown"
        };
        
        public ClusteredGraph()
        {
            clusters = new List<Cluster>();            
        }

        public override string ToString()
        {
            int i = 0;

            StringBuilder returnString = new StringBuilder();
            returnString.AppendLine("graph G {");

            foreach (Cluster cluster in clusters)
            {

                returnString.AppendLine(cluster.ToString().Replace("<COLOR>", colors[i]));
                i++;
            }
            returnString.AppendLine("}");

            return returnString.ToString();
        }

        public List<Cluster> Clusters 
        {
            get
            {
                return clusters;    
            }

            set
            {
                clusters = value;
            }
        }        
    }
}
